package com.project.mall.service;

import com.project.mall.mapper.MapperL;
import com.project.mall.pojo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ServiceImplL implements ServiceL {
    @Resource
    private MapperL mapperL;

    /*查询所有的applianceparam家电信息*/
    @Override
    public List<Applianceparam> allparam() {
        return mapperL.allparam();
    }
    /*增加applianceparam家电信息*/
    @Override
    public int addApplianceparam(Applianceparam applianceparam) {
        return mapperL.addApplianceparam(applianceparam);
    }
    /*删除applianceparam家电信息*/
    @Override
    public int deleApplianceparam(Integer id) {
        return mapperL.deleApplianceparam(id);
    }
    /*修改applianceparam家电信息*/
    @Override
    public int updateApplianceparam(Applianceparam applianceparam) {
        return mapperL.updateApplianceparam(applianceparam);
    }
/*-------------------------------------分割线------------------------------------------------------*/
    /*查询所有的Comment评论信息功能*/
    @Override
    public List<Comment> allComment() {
        return mapperL.allComment();
    }


    /*查询Comment评论表一共有多少条数据信息*/
    @Override
    public Integer allCommentss() {
        return mapperL.allCommentss();
    }

    /*删除所有的Comment评论信息功能*/
    @Override
    public boolean deleComment(Integer id) {
        return mapperL.deleComment(id)>0 ? true:false;
    }
    /*修改所有的Comment评论信息功能*/
    @Override
    public int updateComment(Comment comment) {
        return mapperL.updateComment(comment);
    }






    /*-------------------------------------分割线------------------------------------------------------*/
    /*根据id查询相关的信息Goods*/
    @Override
    public Goods allGoodsId(Integer gid) {
        return mapperL.allGoodsId(gid);
    }
    /*查询Goods所有信息*/
    @Override
    public List<Goods> allGoods() {
        return mapperL.allGoods();
    }

    @Override
    public Integer allGoodss() {
        return mapperL.allGoodss();
    }

    /*根据id删除Goods所有信息*/
    @Override
    public boolean delectGoods(Integer gid) {
        return mapperL.delectGoods(gid)>0 ? true:false;
    }

    /*批量删除Goods信息 根据id*/
    @Override
    public boolean delectssGoods(List<Integer> gid) {
        return mapperL.delectssGoods(gid)>0 ? true:false;
    }

    /*修改Goods信息*/
    @Override
    public boolean updataGoods(Goods goods) {
        return mapperL.updataGoods(goods)>0 ? true:false;
    }
    /*增加Goods信息*/
    @Override
    public boolean addGoods(Goods goods) {
        return mapperL.addGoods(goods)>0 ? true:false;
    }

    /*模糊查询*/
    @Override
    public List<Goods> likegoods(String gname) {
        return mapperL.likegoods(gname);
    }


    /*-------------------------------------分割线------------------------------------------------------*/
   /*根据id查询相关的secondtype信息*/
    @Override
    public Secondtype allSecondtypeId(Integer secid) {
        return mapperL.allSecondtypeId(secid);
    }

    /*模糊查询二级分类信息*/
    @Override
    public List<Secondtype> likeSecondtype(String secname) {
        return mapperL.likeSecondtype(secname);
    }

    /*查询Secondtype信息*/
    @Override
    public List<Secondtype> allSecondtype() {
        return mapperL.allSecondtype();
    }
    /*查询一共有几条数据信息*/
    @Override
    public Integer allNo() {
        return mapperL.allNo();
    }

    /*根据id删除Secondtype信息*/
    @Override
    public boolean deleteSecondtype(Integer secid) {
        return mapperL.deleteSecondtype(secid)>0 ? true:false; }

    /*修改Secondtype信息*/
    @Override
    public boolean updataSecondtype(Secondtype secondtype) {
        return mapperL.updataSecondtype(secondtype)>0 ? true:false;
    }
    /*增加Secondtype信息*/
    @Override
    public boolean addSecondtype(Secondtype secondtype) {
        return mapperL.addSecondtype(secondtype)>0 ? true:false;
    }


    /*-------------------------------------分割线------------------------------------------------------*/

    /*查询所有User信息*/
    @Override
    public List<User> allUser() {
        return mapperL.allUser();
    }

    /*修改  根据id先查询到相关的信息*/
    @Override
    public User allUserById(Integer userid) {
        return mapperL.allUserById(userid);
    }
    /*修改  根据id来修改*/
    @Override
    public boolean updateUser(User user) {
        return mapperL.updateUser(user)>0 ?true:false;
    }
    /* 删除User表的信息  根据id来进行删除*/
    @Override
    public boolean delectUser(Integer userid) {
        return mapperL.delectUser(userid)>0 ? true:false;
    }
    /*查询User表里有几条数据信息*/
    @Override
    public Integer allUserNo() {
        return mapperL.allUserNo();
    }
    /*-------------------------------------分割线------------------------------------------------------*/

    /*查询所有的Feedback表信息*/
    @Override
    public List<Feedback> allFeedback() {
        return mapperL.allFeedback();
    }

    /*根据id删除feedback表的信息*/
    @Override
    public boolean deleteFeedbakcById(@Param("backid") Integer backid) {
        return mapperL.deleteFeedbakcById(backid)>0 ? true:false;
    }

    /*查询意见反馈表一共有几条数据*/
    @Override
    public Integer allFeedbackNo() {
        return mapperL.allFeedbackNo();
    }

    /*-------------------------------------分割线------------------------------------------------------*/

    /*查询admin表的所有信息*/
    @Override
    public List<Admin> allAdmin() {
        return mapperL.allAdmin();
    }

    @Override
    public String pwd(String userid) {
        return mapperL.pwd(userid);
    }

//    @Override
//    public User alluserById(Integer userid) {
//        return mapperL.allUserById(userid);
//    }

    /*根据id修改管理员的密码*/
    @Override
    public boolean updateadmin(Admin admin) {
        return mapperL.updateadmin(admin)>0 ?true:false;
    }

}
